{
	nodeA = $1;
	nodeB = $2;
	startTime = $3;
	endTime = $4;
	
	if (nodeA != currentNodeA || nodeB != currentNodeB) {
		if (numContacts > 0 && currentNodeA < currentNodeB) {
			print currentNodeA, currentNodeB, numContacts, sumDuration/numContacts;
		}

		numContacts = 0;
		sumDuration = 0;

		currentNodeA = nodeA;
		currentNodeB = nodeB;
	}
	
	numContacts++;
	sumDuration += endTime-startTime;
}